package com.hspedu.newData.dmsxl.链表;

import com.hspedu.newData.dmsxl.ds.ListNode;

import java.util.List;

/**
 * @Author: yh
 * @description: 
 * @CreateTime: 2025-05-15 
 * @Version: 1.0
 */

public class LCR024反转链表 {

    public ListNode reverseList(ListNode head) {

       ListNode cur = null;
       while (head!=null){
           ListNode temp = head.next;
           head.next = cur;
           cur = head;
           head = temp;
       }
       return cur;
    }
}
